package com.example.rvdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.rvdemo.common.CommonRVActivity;
import com.example.rvdemo.drag.DragActivity;
import com.example.rvdemo.head.HeadActivity;
import com.example.rvdemo.refre.RefreshLayoutActivity;
import com.example.rvdemo.refreload.RefreshLoadActivity;
import com.example.rvdemo.simple.RVSimpleActivity;
import com.example.rvdemo.slide.SlideActivity;
import com.example.rvdemo.touchanddivider.ClickAndDividerActivity;
import com.example.rvdemo.type.MutTypeActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener{
    private Button btn_simple,btn_type,btn_touchanddivider,btn_common,btn_drag,btn_slidedelete,btn_refresh,btn_head,btn_jicheng;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btn_simple = findViewById(R.id.btn_simple);
        btn_type = findViewById(R.id.btn_type);
        btn_touchanddivider = findViewById(R.id.btn_touchanddivider);
        btn_common = findViewById(R.id.btn_common);
        btn_drag = findViewById(R.id.btn_drag);
        btn_refresh = findViewById(R.id.btn_refresh);
        btn_head = findViewById(R.id.btn_head);
        btn_jicheng = findViewById(R.id.btn_jicheng);
        btn_slidedelete = findViewById(R.id.btn_slidedelete);
        btn_simple.setOnClickListener(this);
        btn_type.setOnClickListener(this);
        btn_touchanddivider.setOnClickListener(this);
        btn_common.setOnClickListener(this);
        btn_drag.setOnClickListener(this);
        btn_slidedelete.setOnClickListener(this);
        btn_refresh.setOnClickListener(this);
        btn_head.setOnClickListener(this);
        btn_jicheng.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_simple:
                startActivity(new Intent(MainActivity.this, RVSimpleActivity.class));
                break;
            case R.id.btn_type:
                startActivity(new Intent(MainActivity.this, MutTypeActivity.class));
                break;
            case R.id.btn_touchanddivider:
                startActivity(new Intent(MainActivity.this, ClickAndDividerActivity.class));
                break;
            case R.id.btn_common:
                startActivity(new Intent(MainActivity.this, CommonRVActivity.class));
                break;
            case R.id.btn_drag:
                startActivity(new Intent(MainActivity.this, DragActivity.class));
                break;
            case R.id.btn_slidedelete:
                startActivity(new Intent(MainActivity.this, SlideActivity.class));
                break;
            case R.id.btn_refresh:
                startActivity(new Intent(MainActivity.this, RefreshLayoutActivity.class));
                break;
            case R.id.btn_head:
                startActivity(new Intent(MainActivity.this, HeadActivity.class));
                break;
            case R.id.btn_jicheng:
                startActivity(new Intent(MainActivity.this, RefreshLoadActivity.class));
                break;
            default:
                break;
        }
    }
}